<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!-- base标签中的href属性可以让页面中所有的相对路径变为绝对路径 -->
<base href="http://192.168.17.50:8080/Web_Ex/">
</head>
<body>
	<center>
	<h1>欢迎 <span style="color: blue">${sessionScope.user.username }</span> 登录，当前在线人数是 <span style="color: red">${applicationScope.count }</span> 人
		<a href="LogoutServlet">注销</a>
	</h1>
	
	<c:if test="${empty requestScope.users }">
		<h1>没有任何用户！！！</h1>
	</c:if>
	<c:if test="${not empty requestScope.users }">
	<table border="1" cellpadding="10" cellspacing="0">
		<tr>
			<th>ID</th>
			<th>UserName</th>
			<th>Password</th>
			<th>Email</th>
			<th colspan="2">Operate</th>
		</tr>
		<c:forEach items="${requestScope.users }" var="user">
				<tr>
					<td>${user.id }</td>
					<td>${user.username }</td>
					<td>${user.password }</td>
					<td>${user.email }</td>
					<td><a href="#">Edit</a></td>
					<td><a href="#">Delete</a></td>
				</tr>
		</c:forEach>
	</table>
	</c:if>
	<br>
	<a href="index.jsp">回首页</a>
	</center>
</body>
</html>